<template>
  <div class="wrap">
    这是数据层<p>{{test}}</p>
  </div>
</template>
<script>
import { ref } from 'vue';
export default {
  name: 'LoadingData',
  components: {

  },
  props: {
    
  },
  async setup() {
    const test = ref(null);
    const p = await new Promise((resolve, reject) => {
        setTimeout(() => {
            test.value = '异步模拟失败';
            // resolve();
            reject({
                msg: '异步失败,请稍后再试试',
                status: false
            })
        }, 2000)
    })
    return {
        p,
        test
    }
  }

}
</script>
<style scoped>
.wrap {
    text-align: center;
    line-height: 50px;
    font-size: 16px;
}
</style>